<?php if($count_offers == 1): ?>
  <div class="notice">Am gasit <?php echo $count_offers ?> reducere</div>
<?php else: ?>
  <div class="notice">Am gasit <?php echo $count_offers ?> reduceri</div>
<?php endif; ?>

<h1>Reduceri <?php echo $query ?></h1>

<?php $i = 0; ?>
<?php foreach($offers as $offer): ?>
  <?php $i++ ?>
  <?php include_partial('index/offer', array('offer' => $offer)) ?>
  <?php if($i == 1): ?>
    <?php include_partial('index/ad1') ?>
  <?php endif; ?>
<?php endforeach; ?>

<?php if($count_offers > 10): ?>
  <div class="pager clearfix">
    <?php echo link_to('&laquo;', '@cauta1?query='.$query.'&page='.$first_page) ?>
    <?php echo link_to('&lt;', '@cauta1?query='.$query.'&page='.$previous_page) ?>
    <?php foreach ($pages as $pag): ?>
      <?php echo ($pag == $page) ? link_to($pag, '@cauta1?query='.$query.'&page='.$pag, array('class' => 'selected')) : link_to($pag, '@cauta1?query='.$query.'&page='.$pag) ?>
    <?php endforeach ?>
    <?php echo link_to('&gt;', '@cauta1?query='.$query.'&page='.$next_page) ?>
    <?php echo link_to('&raquo;', '@cauta1?query='.$query.'&page='.$last_page) ?>
  </div>
<?php endif; ?>